#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''简单的生成器'''
def show_ele(lis):
    print("ready to iterate")
    for i in lis:
        yield i
    print("finish...")

g = show_ele(range(1,21))  #print语句并不执行，将会在第一个next()调用是执行
print("-"*100)
for i in g:
    print("="*150)
    print(i)
    print("="*150)
